package com.zhongyu.comm.vo;

import lombok.Data;

import java.io.Serializable;

@Data
public class Result implements Serializable {

    private String msg;
    private Object  data;
    private int code;

    /**
     * 成功
     * @param msg
     * @return
     */
    public static Result success(String msg){
        Result result = new Result();
        result.setMsg(msg);
        result.setCode(2000);
        return result;
    }

    /**
     * 失败
     * @param msg
     * @return
     */
    public static Result fail(String msg){
        Result result = new Result();
        result.setMsg(msg);
        result.setCode(5000);
        return result;
    }

}
